package com.net.xpay.common.domain.stat;

import com.net.common.domain.CommonDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDate;

@Getter
@Setter
@NoArgsConstructor
public class TransStat extends CommonDomain {
    @ApiModelProperty(notes = "用户当天的交易的时间")
    private LocalDate day;

    @ApiModelProperty(notes = "批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选")
    private String totalTransAmount;

    @ApiModelProperty(notes = "批次总笔数 10 必选")
    private Long totalCount;

    @ApiModelProperty(notes = "成功金额 单位为元")
    private String successAmount;

    @ApiModelProperty(notes = "成功笔数")
    private Long successCount;

    @ApiModelProperty(notes = "失败金额")
    private String failedAmount;

    @ApiModelProperty(notes = "失败笔数")
    private Long failCount;

    @ApiModelProperty(notes = "转账成功率")
    private BigDecimal transSuccessRate;

    @ApiModelProperty(notes = "当日付款支付宝数量")
    private Long paidAlipayUserCount;

    @ApiModelProperty(notes = "当日收款支付宝数量")
    private Long receiveAlipayCount;

    @ApiModelProperty(notes = "当日单笔超过500金额的笔数")
    private Long singleVeryCount;

    @ApiModelProperty(notes = "当日单笔超过500金额的笔数")
    private String singleVeryMerchantIds;

    public static TransStat getInstance(LocalDate day) {
        TransStat instance = new TransStat();
        instance.setDay(day);
        instance.setTotalTransAmount("0.00");
        instance.setFailCount(0L);
        instance.setFailedAmount("0.00");
        instance.setTotalCount(0L);
        instance.setSuccessAmount("0.00");
        instance.setSuccessCount(0L);
        instance.setTransSuccessRate(new BigDecimal(0));
        instance.setPaidAlipayUserCount(0L);
        instance.setReceiveAlipayCount(0L);
        instance.setSingleVeryCount(0L);

        return instance;
    }
}
